// CppUnit-Tutorial
// Datei: bruchtest.h
#ifndef BRUCHTEST_H
#define BRUCHTEST_H

#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include "../include/mysqlInstance.h"

using namespace std;
using namespace oal;

#define UNITTEST_MYSQL_PORT 3306

class testMysqlObject : public CPPUNIT_NS :: TestFixture
{
	CPPUNIT_TEST_SUITE (testMysqlObject);
	CPPUNIT_TEST (testMakeInstance);
	CPPUNIT_TEST (testConnectWithoutLoginReturnsError);
	CPPUNIT_TEST (testConnectWithLoginReturnsTrue);
	CPPUNIT_TEST (testGetDatabaseReturnsTestString);
	CPPUNIT_TEST (testQueryWithWrongSelectReturnError);
	CPPUNIT_TEST (testQueryWithSelectReturnsNothing);
	/**
	 * Testcases for reading writeing tests
	 */
	CPPUNIT_TEST (testSetupTableStrukturForTestcase);

	CPPUNIT_TEST (testMysqlQueryReturnsCorrectCount);
	CPPUNIT_TEST (testSelectTableReturnsCorrentFields);
	CPPUNIT_TEST (testQueryWithSelectReturnsCorrectRecords);
	CPPUNIT_TEST (testQueryWithDeleteOneRecordAndSelectReturnsCorrectRecords);
	CPPUNIT_TEST (testQueryWithUpdateOneRecordReturnsCorrectString);
	CPPUNIT_TEST (testMysqlFetchAssocReturnsCorrectRecords);

	CPPUNIT_TEST (testEraseTableStrukturForTestcase);
	CPPUNIT_TEST_SUITE_END();

	public:
		void setUp (void);
		void tearDown (void);

	protected:
		void testMakeInstance(void);
		void testConnectWithoutLoginReturnsError (void);
		void testConnectWithLoginReturnsTrue (void);
		void testGetDatabaseReturnsTestString (void);
		void testSetupTableStrukturForTestcase (void);
		void testEraseTableStrukturForTestcase (void);
		void testSelectTableReturnsCorrentFields (void);
		void testMysqlQueryReturnsCorrectCount (void);
		void testQueryWithWrongSelectReturnError(void);
		void testQueryWithSelectReturnsNothing(void);
		void testQueryWithSelectReturnsCorrectRecords(void);
		void testQueryWithDeleteOneRecordAndSelectReturnsCorrectRecords(void);
		void testQueryWithUpdateOneRecordReturnsCorrectString (void);
		void testMysqlFetchAssocReturnsCorrectRecords(void);

	private:

};

#endif
